package lambda;

import com.sun.org.apache.bcel.internal.generic.RET;

import java.util.Arrays;
import java.util.Comparator;

/**
 * @author cyt
 * @create 2020-08-11 15:35
 */
public class Demo1 {

    public static void main(String[] args) {

        String[] array = new String[]{"App", "Ornge", "Baana", "Leon"};

        Arrays.sort(array, new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return o1.compareTo(o2);
            }
        });

        for (String s : array) {
            System.out.println(s);
        }

        Arrays.sort(array, (s1, s2) -> {
            return s1.compareTo(s2);
        });


    }
}
